package com.pj.wisdomlogistics.mvp.presenter;


import com.pj.wisdomlogistics.entity.RepairPeopleInfo;
import com.pj.wisdomlogistics.mvp.contract.RepairPoritionContract;
import com.pj.wisdomlogistics.mvp.frame.ActivityPresenter;
import com.pj.wisdomlogistics.mvp.model.RepairPoritionModel;
import com.pj.wisdomlogistics.rx.FilterSubscriber;

import java.util.List;


public class RepairPoritionPresenter extends ActivityPresenter<RepairPoritionModel, RepairPoritionContract.View> implements RepairPoritionContract.Presenter {

    @Override
    public void findFixWorker() {
        addSubscription(getModel().findFixWorker(), new FilterSubscriber<List<RepairPeopleInfo>>() {
            @Override
            public void onNext(List<RepairPeopleInfo> mInfos) {
                getView().onSuccess(mInfos);
            }

            @Override
            public void onError(int errorCode, String errorMsg) {
                getView().onError(errorMsg);
            }
        });
    }
}
